import { REQSEARCHINFO } from "@/api";
import { REQSEARCHLIST } from '../types';
/**
 * search
 */

const state = {
  searchList: [],
};
const getters = {
  goodsList: state => state.searchList.goodsList,
  trademarkList: state => state.searchList.trademarkList,
  attrsList: state => state.searchList.attrsList,
};
const mutations = {
  [REQSEARCHLIST]: (state, commit) => state.searchList = commit,
};
const actions = {
  [REQSEARCHLIST]: async ({ commit }, params) => {
    const { data, code } = await REQSEARCHINFO(params);
    commit(REQSEARCHLIST, data);
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
};
